package com.mf.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: lmf
 * @Create: 2024/7/11 8:24
 * Description:
 */
@Configuration
public class MyBatisConfig {
    /**
     * 分页插件配置
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        // 创建MybatisPlusInterceptor实例
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        // 添加PaginationInnerInterceptor，实现分页功能
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        // 返回配置好的拦截器实例
        return interceptor;
    }
}
